package com.swdegao.iot.netty.thread;
import com.swdegao.iot.netty.entity.Ports;
import com.swdegao.iot.netty.server.NettyServer;


/**
 * Netty 线程启动netty服务器监听
 *
 * @Author:AwakeningCode
 * @Date: Created in 18:50 2018\1\30 0030
 */
public class NettyServerThread extends Thread {


	private boolean _run = true;
	private Ports port;

	public NettyServerThread(Ports port) {
		this.port = port;
	}

	@Override
	public void run() {
		NettyServer server = new NettyServer();
		server.doStart(port);
	}

	public void stopThread(boolean run) {
		this._run = !run;
	}

	public Ports getPort() {
		return port;
	}

	public void setPort(Ports port) {
		this.port = port;
	}

	public boolean is_run() {
		return _run;
	}

	public void set_run(boolean _run) {
		this._run = _run;
	}
}
